function PopupCenter(pageURL,title,w,h)
{
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
    if (window.focus) {
        targetWin.focus()
    }
}

function showPage(thePage, location)
{
    $.ajax({
        cache: false,
        type: "GET",
        url: thePage,
        dataType: "text",
        success: function(response){
            if (thePage == "Register") addScript("Register.js");
            if (thePage == "Login") addScript("Login.js");
            $("#"+location).html(response);
        }
    });
}

function addScript(scriptSource)
{
    var script = document.createElement('script');
    script.id = scriptSource;
    script.type = 'text/javascript';
    script.src = "../customer/script/" + scriptSource;
    var head = document.getElementsByTagName("head")[0];
    head.appendChild(script);
}

function focusIt(target)
{
    var myTarget = document.getElementById(target);
    myTarget.focus();
}


